import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:求和
 * User: wangxin
 * Date: 2024-10-19
 * Time: 18:10
 */
public class test1 {
    public static int n, m;
    public static int sum ;
    public static boolean[] choose = new boolean[11];
    public static void dfs(int x){
        if(sum == m){
            for(int i = 1; i <= n;i++){
                if(choose[i]){
                    System.out.print(i + " ");
                }
            }
            System.out.println("");
            return;
        }
        if(sum > m || x > n){
            return ;
        }
        //选
        sum += x;
        choose[x] = true;
        dfs(x + 1);
        sum -= x;
        choose[x] = false;
        //不选
        dfs(x + 1);


    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

        n = in.nextInt();
        m = in.nextInt();
        dfs(1);


    }
}
